package com.zheng.upms.dao.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zheng.common.base.BaseEntity;

import java.io.Serializable;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author likun
 * @since 2017-12-29
 */
@TableName("upms_user")
public class UpmsUser extends BaseEntity<UpmsUser> {

    private static final long serialVersionUID = 1L;

	public static final Integer IS_REAL_USER = 0;
	public static final Integer IS_NOT_REAL_USER = 1;

    /**
     * 编号
     */
	@TableId(value="user_id", type= IdType.AUTO)
	private Integer userId;
    /**
     * 帐号
     */
	private String username;
	/**
	 * 组织id
	 */
	@TableField("organization_id")
	private Integer organizationId;
    /**
     * 密码MD5(密码+盐)
     */
	private String password;
    /**
     * 盐
     */
	private String salt;
    /**
     * 姓名
     */
	private String realname;
    /**
     * 头像
     */
	private String avatar;
    /**
     * 电话
     */
	private String phone;
    /**
     * 邮箱
     */
	private String email;
    /**
     * 真实用户（0：真实；1虚拟）
     */
	@TableField("real_user")
	private Integer realUser;
    /**
     * 状态(0:正常,1:锁定)
     */
	private Integer locked;

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(Integer organizationId) {
		this.organizationId = organizationId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getRealUser() {
		return realUser;
	}

	public void setRealUser(Integer realUser) {
		this.realUser = realUser;
	}

	public Integer getLocked() {
		return locked;
	}

	public void setLocked(Integer locked) {
		this.locked = locked;
	}

	protected Serializable pkVal() {
		return this.userId;
	}

	@Override
	public String toString() {
		return "UpmsUser{" +
			", username=" + username +
			", organiztionId=" + organizationId +
			", password=" + password +
			", salt=" + salt +
			", realname=" + realname +
			", avatar=" + avatar +
			", phone=" + phone +
			", email=" + email +
			", realUser=" + realUser +
			", locked=" + locked +
			", ctime=" + ctime +
			"}";
	}
}
